package com.chief.sink.rocket;


import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class RocketMqTest {

    public static void main(String[] args) throws Exception {

        //environment 采用jar包提交
        StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();

        //source
        DataStreamSource<String> streamSource = environment.addSource(new RocketMqSource());

        SingleOutputStreamOperator<String> map = streamSource.map(new MapFunction<String, String>() {
            @Override
            public String map(String value) throws Exception {
                return "map res is "+value;
            }
        });

        map.print();

        map.addSink(new RocketMqSink());

        environment.execute("rocket sink9");

    }
}
